package com.ymatou.iapi.trading.userquery.service;

import org.json.JSONException;
import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;

/**
 * 获取用户订单数量Call FreeMaker Template自动生成代码
 */
public class GetBuyerOrderListCountCall_net extends YmatouBaseCall {
	private static String opurl = "api/BuyerQuery/GetBuyerOrderListCount";

	public GetBuyerOrderListCountCall_net() {
		super(EnvSetup.getSystemUrl("api_order_query"), opurl, "POST", "JSON");
	}

	@Override
	public void addDefHeader() {
		client.addHeader("Accept",
				"text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}

	/**
	 * 获取Code
	 * 
	 * @return
	 */
	public String getCode() {
		String Code = null;
		try {
			Code = new JSONObject(getReturnData()).getString("code");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Code;
	}

	/**
	 * 获取BCode
	 * 
	 * @return
	 */
	public String getBCode() {
		String BCode = null;
		try {
			BCode = new JSONObject(getReturnData()).getString("bcode");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return BCode;
	}

	/**
	 * 获取Msg
	 * 
	 * @return
	 */
	public String getMsg() {
		String BCode = null;
		try {
			BCode = new JSONObject(getReturnData()).getString("msg");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return BCode;
	}

	/**
	 * 获取Data
	 * 
	 * @return
	 */
	public JSONObject getData() {
		JSONObject Data = null;
		try {
			Data = new JSONObject(getReturnData()).getJSONObject("data");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Data;
	}

	/**
	 * 获取订单列表
	 * 
	 * @return
	 */
	public JSONObject getAllRecordCountDic() {
		JSONObject temp = null;
		try {
			temp = getData().getJSONObject("allRecordCountDic");
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return temp;
	}

	/**
	 * 获取待点评订单数量
	 * 
	 * @return
	 */
	public Object getAllComplaintedCount() {
		Object AllComplaintedCount = null;
		try {
			AllComplaintedCount = getData().get("allComplaintedCount");
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return AllComplaintedCount;
	}
	
	
	public Object getToBeEvaluatedOrderCount() {
		Object ToBeEvaluatedOrderCount = null;
		try {
			ToBeEvaluatedOrderCount = getData().get("toBeEvaluatedOrderCount");
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return ToBeEvaluatedOrderCount;
	}
}
